package com.cal.utms.core;

import com.cal.utms.action.user_maintenance.LoginAction;
import com.cal.utms.entity.UserGroup;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

public class ScreenAction extends ActionSupport implements ModelDriven<ScreenDto> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private ScreenDto dto = new ScreenDto();
	private int screen_id;
	MenuModel menuModel = new MenuModel();

	public String getPermitionByGroup() {
		UserGroup userGroup = LoginAction.getCurrentLogingUser().getUserGroup();
		menuModel.getScreenPermition(screen_id, userGroup, dto);
		return Action.SUCCESS;
	}

	@Override
	public ScreenDto getModel() {
		return dto;
	}

	public ScreenDto getDto() {
		return dto;
	}

	public void setDto(ScreenDto dto) {
		this.dto = dto;
	}

	public int getScreen_id() {
		return screen_id;
	}

	public void setScreen_id(int screen_id) {
		this.screen_id = screen_id;
	}

}
